<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
</body>
<script>

  function Parent(){}
  function Child(){}

  Child.prototype = new Parent();

  const p = new Parent();
  const c = new Child();

  // console.log(p.__proto__ === Parent.prototype)
  // console.log(c.__proto__.__proto__ === Parent.prototype)

  // console.log( Parent.prototype.isPrototypeOf( p ) );
  // console.log( Parent.prototype.isPrototypeOf( c ) );
  // console.log( Child.prototype.isPrototypeOf( p ) );
  // console.log( Child.prototype.isPrototypeOf( c ) );
  
  // console.log( Object.prototype.isPrototypeOf( c ) );
  // console.log( Object.prototype.isPrototypeOf( p ) );
  // console.log( Object.prototype.isPrototypeOf( Child ) );
  // console.log( Object.prototype.isPrototypeOf( Parent ) );
  // console.log( Object.prototype.isPrototypeOf( document.body ) );



  // console.log( c instanceof Child );
  // console.log( p instanceof Parent );
  // console.log( c instanceof Parent );
  // console.log( p instanceof Child );
  // console.log( p instanceof Object );
  // console.log( c instanceof Object );
  // console.log( Child instanceof Object );
  // console.log( Parent instanceof Object );

  const div = document.querySelectorAll("div");
  console.log(div);

  // 利用原型关系的检测区分数组和对象
  console.log( Array.prototype.isPrototypeOf( {} ) )
  console.log( Array.prototype.isPrototypeOf( [] ) )
  console.log( Array.prototype.isPrototypeOf( div ) )
  
  console.log( {} instanceof Array )
  console.log( [] instanceof Array )
  console.log( div instanceof Array )
</script>
</html>